import { z } from 'zod';
import { flattenNavigationVersions } from '../flattenNavigationVersions.js';
export function refineMissingVersions({ navigation, versions = [], }, ctx) {
    const versionsFromNavigation = flattenNavigationVersions(navigation);
    versionsFromNavigation.forEach((v) => {
        if (!versions.includes(v)) {
            ctx.addIssue({
                code: z.ZodIssueCode.custom,
                message: `Version ${v} is not included in the versions array, but is used in the navigation. Please add ${v} to the versions array.`,
            });
        }
    });
}
